package exceptionhomework;

import java.io.FileOutputStream;

public class SecFinallyDemo2 {
    public static void main(String[] args) {
        System.out.println("程序开始了");
        FileOutputStream fos=null;
        try{
            fos=new FileOutputStream("./s/a.txt");
            fos.write(1);
        }catch (Exception e){
            System.out.println("发生异常并解决");
        }finally {
            try {
                fos.close();
            } catch (Exception e) {
                System.out.println("关闭流发生异常并解决了");
            }
        }
        System.out.println("程序结束了");
    }
}
